home *** CD-ROM | disk | FTP | other *** search
/ Chip 2005 June / ccd0605.iso / Software / Freeware / Programare / highlight / highlight-W32GUI-2.2-10b-Setup.exe / {app} / src / xmlgenerator.h < prev    next >
C/C++ Source or Header  |  2005-03-20  |  3KB  |  92 lines

  1. /***************************************************************************
  2.                           xmlcode.h  -  description
  3.                              -------------------
  4.     begin                : Do 20.01.2005
  5.     copyright            : (C) 2005 by Andre Simon
  6.     email                : andre.simon1@gmx.de
  7.  ***************************************************************************/
  8.  
  9. /***************************************************************************
  10.  *                                                                         *
  11.  *   This program is free software; you can redistribute it and/or modify  *
  12.  *   it under the terms of the GNU General Public License as published by  *
  13.  *   the Free Software Foundation; either version 2 of the License, or     *
  14.  *   (at your option) any later version.                                   *
  15.  *                                                                         *
  16.  ***************************************************************************/
  17.  
  18. #ifndef XMLGENERATOR_H
  19. #define XMLGENERATOR_H
  20.  
  21. #include <string>
  22. #include <sstream>
  23. #include <iostream>
  24.  
  25. #include "codegenerator.h"
  26. #include "version.h"
  27.  
  28. namespace highlight {
  29.  
  30. /**
  31.    \brief This class generates XML.
  32.  
  33.    It contains information about the resulting document structure (document
  34.    header and footer), the colour system, white space handling and text
  35.    formatting attributes.
  36.  
  37. * @author Andre Simon
  38. */
  39.  
  40. class XmlGenerator : public highlight::CodeGenerator
  41.   {
  42.   public:
  43.  
  44.    /** Constructor
  45.      \param colourTheme Name of Colour theme to use
  46.      \param enc encoding name
  47.      \param omitEnc switch to omit encoding information
  48.     */
  49.       XmlGenerator( const string &colourTheme,const string &enc, bool omitEnc=false);
  50.  
  51.    XmlGenerator();
  52.  
  53.     ~XmlGenerator();
  54.  
  55.    /** prints document header
  56.        \param  title Title of the document
  57.     */
  58.     string getHeader(const string & title);
  59.  
  60.     /** Prints document footer*/
  61.     string getFooter();
  62.  
  63.     /** Prints document body*/
  64.     void printBody();
  65.  
  66.   private:
  67.  
  68.     string styleDefinitionCache, encoding;
  69.  
  70.     bool omitEncoding;
  71.  
  72.     string getStyleDefinition();
  73.  
  74.     string formatStyleAttributes(const string &, const ElementStyle &);
  75.  
  76.     /** \return escaped character*/
  77.     virtual string maskCharacter(unsigned char );
  78.  
  79.  
  80. //    string getNewLine();
  81.  
  82.     string getOpenTag(const string& );
  83.     string getCloseTag(const string& );
  84.  
  85.     string getMatchingOpenTag(unsigned int styleID);
  86.     string getMatchingCloseTag(unsigned int styleID);
  87.   };
  88.  
  89. }
  90.  
  91. #endif
  92.